#pragma once

#include "pch.h"
#include "IndirectAdapter.h"
#include "IndirectMonitor.h"
#include "IoControl.h"

//struct IndirectAdapterContext {
//	indirect_disp::IndirectAdapter* pIndirectAdapter;
//
//	void Cleanup()
//	{
//		delete pIndirectAdapter;
//		pIndirectAdapter = nullptr;
//	}
//};
//WDF_DECLARE_CONTEXT_TYPE(IndirectAdapterContext);
//
//struct IndirectMonitorContext
//{
//	indirect_disp::IndirectMonitor* pIndirectMonitor;
//
//	void Cleanup()
//	{
//		delete pIndirectMonitor;
//		pIndirectMonitor = nullptr;
//	}
//};
//WDF_DECLARE_CONTEXT_TYPE(IndirectMonitorContext);
//
struct AdapterWdfContext {
	indirect_disp::IndirectAdapter *pIndirectAdapter = nullptr;

	void Cleanup() {
		if (pIndirectAdapter) {
			OutputDebugString(TEXT("[VirtualMon] cleanup AdapterWdfContext\n"));
			delete pIndirectAdapter;
			pIndirectAdapter = nullptr;
		}
	}
};
WDF_DECLARE_CONTEXT_TYPE(AdapterWdfContext);

struct MonitorWdfContext
{
	indirect_disp::IndirectMonitor* pIndirectMonitor = nullptr;

	void Cleanup() {
		OutputDebugString(TEXT("[VirtualMon] cleanup MonitorWdfContext\n"));
		delete pIndirectMonitor;
		pIndirectMonitor = nullptr;
	}
};
WDF_DECLARE_CONTEXT_TYPE(MonitorWdfContext);

EXTERN_C_START

DRIVER_INITIALIZE DriverEntry;

EXTERN_C_END
